<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopReviews extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_reviews', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('shopid')->comment('原商家代码');
            $table->string('code')->unique()->comment('商家代码');
            $table->string('name')->comment('商家名称');
            $table->string('logo')->comment('商家logo');
            $table->integer('firstclassid')->comment('一级分类id');
            $table->integer('secondclassid')->comment('二级分类id');
            $table->string('firstclassname')->comment('一级分类名称');
            $table->string('secondclassname')->comment('二级分类名称');
            $table->string('label')->default('')->comment('标签');
            $table->decimal('maxsales', 16, 2)->comment('最大消费金额');
            $table->integer('provinceid')->comment('省份id');
            $table->integer('cityid')->comment('城市id');
            $table->integer('districtid')->comment('区县id');
            $table->integer('businessareaid')->comment('商圈id');
            $table->string('cityname')->comment('城市名称');
            $table->string('districtname')->comment('区县名称');
            $table->string('businessareaname')->comment('商圈名称');
            $table->string('longitude')->comment('经度');
            $table->string('latitude')->comment('纬度');
            $table->string('address')->comment('详细地址');
            $table->string('hours')->comment('营业时间');
            $table->integer('buynumber')->comment('当日最大消费次数');
            $table->integer('weekdoubleday')->comment('每周最多翻倍天数');
            $table->string('photos',1000)->nullable()->comment('环境组图');
            $table->string('goodsphotos',1000)->nullable()->comment('产品组图');
            $table->string('consumerinfo',1000)->nullable()->comment('消费须知');
            $table->string('invoice')->nullable()->comment('发票信息');
            $table->string('notpartakegoods')->nullable()->comment('不参与的商品');
            $table->string('content')->nullable()->comment('其他');
            $table->string('description',1000)->nullable()->comment('商家简介');
            $table->string('contactnumber')->default('')->comment('联系电话');
            $table->string('smsphone')->default('')->comment('接收短信手机');
            $table->string('businesshours')->nullable()->comment('营业时间');
            $table->integer('maintainerid')->comment('系统维护人id');
            $table->string('parentmobile',11)->comment('负责人账号');
            $table->string('parentname',11)->comment('负责人姓名');
            $table->string('idcard',18)->comment('身份证号');
            $table->string('contractstarttime')->default('')->comment('合约开始时间');
            $table->string('contractendtime')->default('')->comment('合约结束时间');
            $table->string('cardholder', 30)->comment('持卡人');
            $table->string('bankname',20)->comment('所属银行');
            $table->string('bankcard',30)->comment('银行卡号');
            $table->string('opencardbank',30)->comment('开户行');
            $table->string('bankprovince',30)->default('')->comment('银行卡所属省');
            $table->string('bankcity',30)->default('')->comment('银行卡所属市');
            $table->string('bankcardphoto')->default('')->comment('银行卡正面照');
            $table->string('licensephoto')->default('')->comment('营业执照照片');
            $table->string('idcardfrontphoto')->default('')->comment('身份证正面照');
            $table->string('idcardbackphoto')->default('')->comment('身份证背面照');
            $table->string('childmobile',1000)->default('')->comment('子账号');
            $table->string('updatecontent')->default('')->comment('修改内容，json格式');
            $table->string('event',5000)->comment('翻倍日');
            $table->string('eventremark')->default('')->comment('翻倍日历备注');
            $table->string('note')->default('')->comment('记录说明：如下(自助开户/自助修改/商务开户/商务修改)');
            $table->tinyInteger('status')->default(0)->comment('状态0用户自助开户或修改等待商务审核1自助开户或修改商务已审核或商务开户或修改等待客服审核2客服审核通过');
            $table->integer('shopuserid')->comment('商户申请人ID');
            $table->string('firstverifynote')->default('')->comment('第一次审核说明');
            $table->integer('firstverifyid')->default(0)->comment('第一次审核人ID');
            $table->string('firstverifytime')->default('')->comment('第一次审核时间');
            $table->string('lastverifynote')->default('')->comment('最终审核说明');
            $table->integer('lastverifyid')->default(0)->comment('最终审核人ID');
            $table->string('lastverifytime')->default('')->comment('最终审核时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
